using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using bitzhuwei.Compiler;

namespace bitzhuwei.AnsiCFormat {
    /// <summary>
    /// Correspond to the Vn node unary_operator in the grammar(AnsiC).
    /// </summary>
    internal partial class Vnunary_operator : IFullFormatter {
        // [020]=unary_operator : '&' ;
        // [021]=unary_operator : '*' ;
        // [022]=unary_operator : '+' ;
        // [023]=unary_operator : '-' ;
        // [024]=unary_operator : '~' ;
        // [025]=unary_operator : '!' ;

        private readonly TokenRange _scope;
        public TokenRange Scope => _scope;

        public void Format(TextWriter writer, FormatContext context) {
            throw new NotImplementedException();
        }

        public void FullFormat(BlankConfig preConfig, TextWriter writer, FormatContext context) {
            context.PrintBlanksAnd(this.token, preConfig, writer);
        }

        public IEnumerable<string> YieldTokens(TextWriter writer, FormatContext context) {
            throw new NotImplementedException();
        }

        internal readonly Token token;

        internal Vnunary_operator(Token token) {
            this.token = token;
            this._scope = new TokenRange(token);
        }

    }
}
